"use strict"

/**
 * 郑州市政府采购网爬虫
 *  
 */

var Base = require("./base");
var zz_spider = new Base();
zz_spider.name = "郑州市政府采购网";

zz_spider.getPageUrl = function (pg) {
    var url = "http://www.hngp.gov.cn/zhengzhou/ggcx?appCode=H60&channelCode=0101";
    if (pg != 1) {
        url = "http://www.hngp.gov.cn/zhengzhou/ggcx?appCode=H60&channelCode=0101&bz=0&pageSize=10&pageNo=" + pg;
    }
    return url;
};

zz_spider.getItems = function ($) {
    var items = [];
    $(".List2 ul li a").each(function (index, ele) {
        var e = $(ele);
        var item = {};
        item.title = e.text();
        item.url = "http://www.hngp.gov.cn" + e.attr("href");
        item.source = zz_spider.name;
        items.push(item);
    });
    return items;
};

exports = module.exports = zz_spider;